package com.zto.sch.advance.excel;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by guotao on 2018/7/12.
 *
 * @Description: 存放会员错误信息和code 自己的
 */
public enum MemberReturnCodeEnum {
    SUCCESS("0","成功"),
    SYSTEM_ERROR("-1", "系统错误"),
    FAIL("1", "处理失败"),

    // 参数错误
    INVALID_PARAMETER("600002","无效参数"),
    // 导入即会员错误码
    INVALID_PARA_NULLPHONE("600002", "手机号不能为空"),
    INVALID_PARA_IS_ALREADY_MEMBER("600003", "已经是会员"),
    ERROR_GET_WID_BY_SOURCE("600005", "授权wid失败"),
    ERROR_CHANNEL_TYPE("600006", "渠道不正确"),
    INVALID_PARA_NAME_IS_TOOLONG("600007", "姓名最多不超过50个字"),
    INVALID_PARA_PHONE_IS_ILLEGAL("600008", "手机号只可填写11位数字"),
    INVALID_PARA_DEPOSITAMOUNT_IS_ILLEGAL("600009", "实充金额只可填写大于或等于0的数且最大不超过1亿"),
    INVALID_PARA_GIVEAMOUNT_IS_ILLEGAL("600010", "赠送金额只可填写大于或等于0的数且最大不超过1亿"),
    INVALID_PARA_POINT_IS_ILLEGAL("600011", "积分只可填写大于或等于0的数且最大不超过1亿"),
    INVALID_PARA_GROWTH_IS_ILLEGAL("600012", "成长值只可填写大于或等于0的数且最大不超过1亿"),
    INVALID_PARA_BIRTHDAY_IS_ILLEGAL("600013", "生日格式不正确-格式：年/月/日；例如：2015/01/20，大于1900/01/01"),
    INVALID_PARA_IDCARD_IS_ILLEGAL("600014", "身份证只能输入18个字"),
    INVALID_PARA_EMAIL_IS_ILLEGAL("600015", "邮箱最多输入50个字"),
    INVALID_PARA_ADDRESS_IS_ILLEGAL("600016", "详细地址最多输入200个字"),
    INVALID_PARA_EDUCATION_IS_ILLEGAL("600017", "教育背景最多输入50个字"),
    INVALID_PARA_INDUSTRY_IS_ILLEGAL("600018", "行业最多输入50个字"),
    INVALID_PARA_HOBBY_IS_ILLEGAL("600019", "兴趣爱好最多输入255个字"),
    INVALID_PARA_PROFESSION_IS_ILLEGAL("600020", "职业最多输入50个字"),
    INVALID_PARA_INCOME_IS_ILLEGAL("600021", "收入最多输入30个字"),
    INVALID_PARA_CHANNEL_TYPE_IS_ILLEGAL("600022", "领卡渠道不合法"),
    MC_EXCEPTION("600023", "MC异常"),
    INVALID_PARA_NULLOPENID("600024", "openId不能为空"),
    INVALID_PARA_ISREPEAT("600025", "导入的数据重复"),
    INVALID_PARA_PHONE_EXIST("600026", "用户数据已存在"),
    INVALID_PARA_STORE_NOT_CREATE("600027", "后台未创建该门店"),
    INVALID_PARA_OPENENID_IS_ILLEGAL("600028", "公众号openid不正确"),
    INVALID_PARA_MINI_OPENENID_IS_ILLEGAL("600029", "小程序openid不正确"),
    INVALID_PARA_APPID_IS_EMPTY("600030", "appId不能为空"),
    ;

    MemberReturnCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private String code;
    private String msg;

    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.msg;
    }


    private static final Map<String, MemberReturnCodeEnum> codeToEnum = new HashMap<String, MemberReturnCodeEnum>();
    static {
        for (MemberReturnCodeEnum status : MemberReturnCodeEnum.values()) {
            codeToEnum.put(status.getCode(), status);
        }
    }

    public static MemberReturnCodeEnum getMemberErrorEnum(String code) {
        return codeToEnum.get(code);
    }
}
